package com.example.userinfodemo1;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {

    //定义对象
    private EditText etName,etEmail;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //绑定控件
        etName = findViewById(R.id.et_name);
        etEmail = findViewById(R.id.et_email);
    }
    //创建按钮点击方法
    public void btn_submit(View view) {
        //按钮单击事件
        Bundle bundle = new Bundle();
        bundle.putString("name",etName.getText().toString());
        bundle.putString("email",etEmail.getText().toString());
        Intent intent = new Intent(MainActivity.this,ShowUserInfoActivity.class);
        intent.putExtras(bundle);
        startActivity(intent);
    }
}
